<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>收件箱</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<link href="/oa/css/message.css" type="text/css" rel="stylesheet" />
<link href="/oa/css/style.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="js/jquery-1.4.4.min.js"></script>
<script type="text/javascript">
	function showDetail(id) {
		//window.parent.leftFrame.location.reload();
		window.location.href =  '<s:url action="updateIsRead" namespace="/messageManage" />' + '?showId=' + id;
		window
				.open(
						'/oa/page/message/messageDetail.jsp?id=' + id,
						"消息详情",
						"height=450, width=550, top=0, left=0,toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, status=no");
	};
	function topage(page) {
		var form = document.forms[0];
		form.currentpage.value = page;
		form.submit();
	}
	$(document).ready(
			function(e) {
				$("#checkAll").click(
						function() {
							$("body :checkbox").attr("checked",
									$("#checkAll").attr("checked"));
						});
				$("#btnDel").click(function() {
					var sure = confirm("确认删除？")
					if (sure) {
						var form = document.forms[0];
						form.submit();
					} else {
						return false;
					}
				});
			});
</script>
</head>

<body>
	<s:form namespace="/messageManage" action="deleteInboxByIds">
	<s:hidden name="currentpage" />
		<table class="data_list_table">
			<tr>
				<td align="center"><input type="checkbox" id="checkAll" />全选</td>
				<td colspan="4" align="left"><input type="button" value="删除选定项"
					id="btnDel" class="common_button" />
				</td>
				<td align="right"><input type="button" value="返回"
					onclick="history.go(-1)" class="common_button" /></td>
			</tr>
			<tr>
				<th>删除</th>
				<th>发件人</th>
				<th>是否已读</th>
				<th>主题</th>
				<th>发送时间</th>
				<th>紧急程度</th>
			</tr>
			<s:iterator value="pageView.records" status="entry">
				<tr>
					<td align="center"><input type="checkbox" value="${id}"
						name="delIds" />
					</td>
					<td align="center">${fromUser.userName }</td>
					<td align="center"><s:if test="isRead == 0 ">
					未读
					</s:if> <s:else>
						已读
					</s:else></td>
					<td align="center"><label id="messageTitle"
						style="cursor: pointer;" onclick="showDetail('${id}')">${message.title}</label>
					</td>
					<td align="center"><s:date name="message.recordTime "
							format="yyyy年MM月dd日" />
					</td>
					<td align="center">${message.messageType.title }消息</td>
				</tr>
			</s:iterator>
			<tr>
				<th colspan="6" class="pager">
					<div class="pager">
						<s:include value="/page/share/paging.jsp"></s:include>
					</div>
				</th>
			</tr>
		</table>
	</s:form>
</body>
</html>
